import '../plugins/axios';
// axios.defaults.withCredentials = true;
//wangjunze
let base='https://www.easy-mock.com/mock/5bbb221eb8f16454280d5e68/nba';//test

export const login              = param =>{return axios.post(`${base}/account/login`                  ,param);}; //登录接口
export const keyPair            = param =>{return axios.get( `${base}/account/keyPair`                ,param);}; //加密接口
export const uploadAvatar       = param =>{return axios.put( `${base}/account/uploadAvatar`           ,param);};// upload avatar
export const getCurrentUserInfo = ()    =>{return axios.get( `${base}/account/queryCurrentUserInfo`);}; // get current user info
export const logOut             = ()    =>{return axios.get( `${base}/account/logout`);}; // logout
export const getUserListInfo    = param =>{return axios.post(`${base}/account/queryAccounts`          ,param);};//获取用户列表信息
export const searchUser         = param =>{return axios.post(`${base}/account/queryAccountByCondition`,param);};//查询用户列表信息
export const addUser            = param =>{return axios.put( `${base}/account/save`                   ,param);};//新增用户列表信息
export const updateUser         = param =>{return axios.post(`${base}/account/update`                 ,param);};//更新用户信息

export const addPermission      = param =>{return axios.put( `${base}/permission/savePermission`      ,param);};//add permission
export const getPermissionList  = param =>{return axios.post(`${base}/permission/queryPermissions`    ,param);};//get permission list
export const editPermission     = param =>{return axios.post(`${base}/permission/updatePermission`    ,param);};//edit permission

//角色管理
export const getRole  = param =>{return axios.post(`${base}/role/queryRole`,param);};//查询全部角色列表信息
export const saveRole = param =>{return axios.put( `${base}/role/saveRole` ,param);};//新增角色列表信息